package com.lagou;

public class PhoneTest {
    public static void show(IPlayGame i1){
        i1.playGame();
    }
    public static void main(String[] args) {
        CellPhone c1 = new OldPhone();
        c1.callnumber();
        c1.sendmessage();
        System.out.println("-----------------");

        CellPhone c2 = new NewPhone();
        c2.callnumber();
        c2.sendmessage();
        System.out.println("-----------------");

        ((NewPhone)c2).playGame(new IPlayGame() {
            @Override
            public void playGame() {
                System.out.println("添加了玩游戏的新功能");
            }
        });



    }

}
